<%= form_for [@review_type, @review] do |f| %>
  
  <% if @review.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@review.errors.count, "error") %> prohibited this review from being saved:</h2>

      <ul>
      <% @review.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label @review_type.overall_rating_criterion.name, "Your overall rating"%>
    </br>
    <% @review_type.overall_rating_criterion.rating_scale_elements.each do |rating_scale_element| %>
      <%= radio_button_tag(@review_type.overall_rating_criterion.prefixed_name, rating_scale_element.value,false, :title=>rating_scale_element.fullname) %>
    <% end %>
  </div>
  
  <div class="field">
    <%= f.label(:title, "Title of your review") %></br>
    <%= f.text_field :title %>
  </div>
  <div class="field">
    <%= f.label(:review_text, "Your review") %></br>
    <%= f.text_area :review_text %>
  </div>
  
  <table>
  <% @review_type.custom_rating_criterions.each do |rating_criterion| %>
    <tr>
      <td>
      <%= f.label rating_criterion.name,rating_criterion.name%>
      </td>
      <td>
        <% rating_criterion.rating_scale_elements.each do |rating_scale_element| %>
          <%= radio_button_tag(rating_criterion.prefixed_name, rating_scale_element.value,false, :title=>rating_scale_element.fullname) %>
        <% end %>
      </td>
    </tr>
  <% end %>
  </table>
  
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
